#ifndef SERVICEWRAPPER_H
#define SERVICEWRAPPER_H

#include <QCoreApplication>
#include "timerservice.h"

class ServiceWrapper : public QtService<QCoreApplication>
{
public:
    ServiceWrapper(int argc, char *argv[]):
        QtService<QCoreApplication>(argc, argv, SP_NAME)
    {
        setServiceDescription("TimerService For QVertex Project");
    }

protected:
    void start()
    {
        QCoreApplication *app = application();
        sp_setRegValue(REG_APP,"serviceName",serviceName());
        sp_setRegValue(REG_APP,"status","Running");

        timer=new TimerService(app);
        timer->start();
    }

    void stop()
    {
        sp_setRegValue(REG_APP,"status","Stopped");
        timer->stop();
    }

private:
    TimerService *timer;
};

#endif // SERVICEWRAPPER_H
